﻿<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true"
    CodeFile="ProductCatChild.aspx.cs" Inherits="Admin_ProductCat" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <div id="page-heading">
        <h1>
            Add or Update SubCategory</h1>
    </div>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized">
                <img src="images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
            <th class="topleft">
            </th>
            <td id="tbl-border-top">
                &nbsp;</td>
            <th class="topright">
            </th>
            <th rowspan="3" class="sized">
                <img src="images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
        </tr>
        <tr>
            <td id="tbl-border-left">
            </td>
            <td>
                <!--  start content-table-inner -->
                <div id="content-table-inner">
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <contenttemplate>
                    <table border="0" width="100%" cellpadding="0" cellspacing="0">
                        <tr valign="top">
                            <td>
                                <!-- start id-form -->
                               
                                <table border="0" cellpadding="0" cellspacing="0" id="id-form">
                                    <tr>
                                        <th valign="top">
                                            Name:</th>
                                        <td>
                                            <input type="text" class="inp-form" id="txtName" width="300" runat="server" />
                                        </td>
                                        <td>
                                            <trong><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="<div class='error-left'></div> <div class='error-inner'><span style='color: White;'> Name is not empty</span></div>"
                                                ControlToValidate="txtName"></asp:RequiredFieldValidator></trong>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th valign="top">
                                            Category :</th>
                                        <td>
                                            <asp:DropDownList ID="ddlProCat" CssClass="textall" runat="server" OnSelectedIndexChanged="ddlProSubCat_OnSelectedIndexChanged"
                                                    AutoPostBack="true"  >
                                            </asp:DropDownList>
                                        </td>
                                        <td>
                                            <asp:CustomValidator ID="cusDepartment" runat="server" ControlToValidate="ddlProCat" ClientValidationFunction="ClientValidationDDl"><div class='error-left'></div> <div class='error-inner'><span style='color: White;'> Category is not Null</span></div></asp:CustomValidator>
                                        </td>
                                    </tr>
                                     <tr>
                                        <th valign="top">
                                            SubCategory:</th>
                                        <td>
                                            <asp:DropDownList ID="ddlSubCat" CssClass="textall" runat="server" >
                                            </asp:DropDownList>
                                        </td>
                                        <td>
                                            <asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="ddlSubCat" ClientValidationFunction="ClientValidationDDl"><div class='error-left'></div> <div class='error-inner'><span style='color: White;'> SubCategory is not Null</span></div></asp:CustomValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th valign="top">
                                            SortOrder:</th>
                                        <td>
                                            <input type="text" class="inp-form" id="txtOrder" runat="server" onkeyup="this.value = FormatNumber(this.value);" /></td>
                                        <td>
                                            <trong>
                                            <asp:RegularExpressionValidator ID="RetxtOrder" runat="server" ControlToValidate="txtOrder"
                                                ValidationExpression="^[0-9,.,#]+$" ErrorMessage="(*)"></asp:RegularExpressionValidator></trong>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th valign="top">
                                            Description:</th>
                                        <td>
                                            <textarea rows="5" id="txtDes" runat="server" cols="3" class="form-textarea"></textarea></td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>
                                            &nbsp;</th>
                                        <td valign="top">
                                            <asp:Button ID="btnsave" CausesValidation="true" OnClientClick="return CheckValue()" CssClass="form-submit" Text="Save" runat="server" OnClick="btnsave_Click" />
                                            <asp:Button ID="btnexit" CssClass="form-reset" Text="Reset" runat="server" OnClick="btnexit_Click"
                                                CausesValidation="False" />
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                </table>
                                 
                                <!-- end id-form  -->
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <img src="images/shared/blank.gif" width="695" height="1" alt="blank" /></td>
                            <td>
                            </td>
                        </tr>
                    </table>
                    </contenttemplate>
                    </asp:UpdatePanel>
                    <div class="clear">
                    </div>
                </div>
                <!--  end content-table-inner  -->
            </td>
            <td id="tbl-border-right">
            </td>
        </tr>
        <tr>
            <th class="sized bottomleft">
            </th>
            <td id="tbl-border-bottom">
                &nbsp;</td>
            <th class="sized bottomright">
            </th>
        </tr>
    </table>
    <div class="clear">
        &nbsp;</div>
        <script type="text/javascript">
            function CheckValue()
            {
                {
                
                 var ddlProCat=document.getElementById("<%=ddlProCat.ClientID%>");
                 var ddlSubCat=document.getElementById("<%=ddlSubCat.ClientID%>");
                 var txtName=document.getElementById("<%=txtName.ClientID%>");
                 if(txtName.value=='')
                 {
                    alert('Name is not Null !');
                    return false;
                 }
                 if(ddlProCat.value=='0')
                 {
                    alert('Category is not Null !');
                    return false;
                 }
                 if(ddlSubCat.value=='0')
                 {
                    alert('SubCategory is not Null !');
                    return false;
                 }
                 else
                 {
                    return true;
                 }
                
            }
            }
        </script>
</asp:Content>
